## Registered S3 method overwritten by 'quantmod':
##   method            from
##   as.zoo.data.frame zoo
## 
## Attaching package: 'highcharter'
## The following object is masked _by_ '.GlobalEnv':
## 
##     stars
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
p <- ggplot(sp, aes(Err, Dens, color = Asteroid)) + 
  geom_point() + 
  theme_bw()
ggplotly(p)
library(highcharter)
hchart(sp, "point", hcaes(x = Err, y = Dens, group = Asteroid))
hchart(sp, "line", hcaes(x = Err, y = Dens, group = Asteroid))
#NGC4472 Galaxy 

hc<- hchart(gal2, type = "scatter", hcaes(radius,surf_mag),
            name = "Radius and Surface Mag of NGC4472 Galaxy",
            showInLegend = TRUE
)

hc
fig <- plot_ly(fireball, x = ~Altitude_km, y = ~Velocity_km_s, z = ~Total_Radiated_Energy, marker = list(color = "blue"), showscale = TRUE )

fif <- fig %>% layout(scene = list(xaxis = list(title = "Altitude Km"),
                                   yaxis = list(title = "Velocity km/s"),
                                   zaxis = list(title = "Total Radiated Energy (J)")))

fig
## No trace type specified:
##   Based on info supplied, a 'scatter3d' trace seems appropriate.
##   Read more about this trace type -> https://plot.ly/r/reference/#scatter3d
## No scatter3d mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plot.ly/r/reference/#scatter-mode
## Warning: Ignoring 618 observations
## Warning: `arrange_()` is deprecated as of dplyr 0.7.0.
## Please use `arrange()` instead.
## See vignette('programming') for more help
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_warnings()` to see where this warning was generated.
## Warning: 'scatter3d' objects don't have these attributes: 'showscale'
## Valid attributes include:
## 'type', 'visible', 'showlegend', 'legendgroup', 'opacity', 'name', 'uid', 'ids', 'customdata', 'meta', 'hoverlabel', 'stream', 'transforms', 'uirevision', 'x', 'y', 'z', 'text', 'texttemplate', 'hovertext', 'hovertemplate', 'mode', 'surfaceaxis', 'surfacecolor', 'projection', 'connectgaps', 'line', 'marker', 'textposition', 'textfont', 'hoverinfo', 'error_x', 'error_y', 'error_z', 'xcalendar', 'ycalendar', 'zcalendar', 'scene', 'idssrc', 'customdatasrc', 'metasrc', 'xsrc', 'ysrc', 'zsrc', 'textsrc', 'texttemplatesrc', 'hovertextsrc', 'hovertemplatesrc', 'textpositionsrc', 'hoverinfosrc', 'key', 'set', 'frame', 'transforms', '_isNestedKey', '_isSimpleKey', '_isGraticule', '_bbox'

The Bubble Plot below is a vital ploy in understanding how Galaxies are observed through data. Here using plotly, we hage created an interactive bubble plot. our X is the Rmag which is the total red band magnitude, which is the inverted logarithmic measure of the galaxies brightness. The y is the difference between total and aperture magnitude in the R band. In other words, it is a rough measure of the size of the galaxy. the number below the coordinates of each bubble is the obect number ie the number the galaxy is classified as

The variable that effects the size of each bubble is mumax which is the central surface brightness of each galaxy

It is noted that the difference between R mag and mu_mx should be also be an indicator of the galaxy size

red <- plot_ly(combo, x = ~Rmag, y = ~ApDRmag, text = ~Nr, type = "scatter", mode = 'markers',
               marker = list(size = ~mumax, opacity = 0.5))
red <- red %>% layout(title = "Magnitude of Logarithmic Brightness Against size of Galaxy",
                      xaxis = list(showgrid = FALSE),
                      yaxis = list(showgrid = FALSE))

red

Here we created a new variable where we took the difference in Rmag and mumax as this is also an indicator of a size of each galaxy recorded. we used this new variable as our y to compare and see how reliable it is estimating the size along with x still remaining as our RMag. For the most part, both plots seem to be similar, with a few remaining outliers in the second plot that do not occur in the first plot

library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
combo_n = mutate(combo, Diff_R_Mu = Rmag - mumax )

red2 <- plot_ly(combo_n, x = ~Rmag, y = ~Diff_R_Mu, text = ~Nr, type = "scatter", mode = 'markers', color = "red",marker = list(size = ~mumax, opacity = 0.5))

red2 <- red2 %>% layout(title = "Magnitude of Brightness against Estimated Size",
                        xaxis = list(showgrid = FALSE),
                        yaxis = list(showgird = FALSE))
red2
## Warning in RColorBrewer::brewer.pal(N, "Set2"): minimal value for n is 3, returning requested palette with 3 different levels

## Warning in RColorBrewer::brewer.pal(N, "Set2"): minimal value for n is 3, returning requested palette with 3 different levels